<?php
	//Includes
	include("include/class.connection.php");
	include("include/functions.php");
	
	//Stat session
	session_start();
	
	//Getting the proffesors info
	$sql="SELECT * FROM proffesors WHERE user_id={$_SESSION['userId']}";
	$result=mysql_query($sql) or die(mysql_error());
	$proff=mysql_fetch_array($result);
	$_SESSION['proff_id']=$proff['proffesor_id'];
	$_SESSION['proff_name']=$proff['name'];
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function altRows(id){
	if(document.getElementsByTagName){  
		
		var table = document.getElementById(id);  
		var rows = table.getElementsByTagName("tr"); 
		 
		for(i = 0; i < rows.length; i++){          
			if(i % 2 == 0){
				rows[i].className = "evenrowcolor";
			}else{
				rows[i].className = "oddrowcolor";
			}      
		}
	}
}

window.onload=function(){
	altRows('alternatecolor2');
	altRows('alternatecolor');
}
</script>
<link rel="stylesheet" type="text/css" href="styles/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
PROFESOR
<br/>
Здраво <b><?php echo($proff['name']." ".$proff['proffesor_id']); ?></b><br/><br />
Вас Клас е:  <?php checkMaster(); ?>
<h1>Распоред прва смена</h1>
<table  class="altrowstable" id="alternatecolor" >
	<tr>
    	<th>&nbsp;</th>
        <th>Понеделник</th>
        <th>Вторник</th>
        <th>Среда</th>
        <th>Четврток</th>
        <th>Петок</th>
    </tr>
    
    	<?php
		for($i=1; $i<=7; $i++)
		{
			echo("<tr><td><b>{$i}.</b></td>");
			for($j=1; $j<=5; $j++)
			{
				sceduleDay($j,$i,1);
			}
			echo("</tr>");
		}
		?>
</table>


<h1>Распоред втора смена</h1>
<table class="altrowstable" id="alternatecolor2" >
	<tr>
    	<th>&nbsp;</th>
        <th>Понеделник</th>
        <th>Вторник</th>
        <th>Среда</th>
        <th>Четврток</th>
        <th>Петок</th>
    </tr>
    
    	<?php
		for($i=1; $i<=7; $i++)
		{
			echo("<tr><td><b>{$i}.</b></td>");
			for($j=1; $j<=5; $j++)
			{
				sceduleDay($j,$i,2);
			}
			echo("</tr>");
		}
		?>
</table>
</body>
</html>